home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / PAS_0793 / DTEGAVGA.PAS < prev    next >
Pascal/Delphi Source File  |  1993-08-01  |  2KB  |  47 lines

  1. {─ Fido Pascal Conference ────────────────────────────────────────────── PASCAL ─
  2. Msg  : 85 of 109                                                                
  3. From : Jon Taylor                          1:363/640.0          29 Jun 93  20:17 
  4. To   : John Dailey                         1:374/38.0                            
  5. Subj : VGA Info                                                               
  6. ────────────────────────────────────────────────────────────────────────────────
  7. * In a message originally to All, John Dailey said:
  8.  
  9.  > I'm looking for a quick-and-dirty way of checking to see if a
  10.  > user has VGA capability in text mode.  ie. 50 line mode.  Any
  11.  > help is appreciated.}
  12.  
  13. Function CRTIsVGA : BOOLEAN;
  14. Var
  15.   R : REGISTERS;
  16. BEGIN
  17.   R.AX := $1A00;
  18.   R.DS := $0;
  19.   R.ES := $0;  Intr( $10, R );
  20.   CRTIsVGA := (R.AL=$1A) and ((R.BL=7) or (R.BL=8));
  21. END;
  22. .
  23. Function CanEGA : BOLLEAN; Var
  24.   R : REGISTERS;
  25. BEGIN
  26.   R.AH := $12;
  27.   R.BL := $10;
  28.   R.ES := $0;
  29.   R.DS := $0;
  30.   Intr( $10,R );
  31.   CRTisEGA := (R.BL<>$10);
  32. END; .
  33. Function NumRows : BYTE;
  34. BEGIN
  35.   If Mem[ Seg0040:$84 ]>25 Then
  36.     NumRows := Mem[ Seg0040:$84 ]
  37.   Else
  38.     NumRows := 25;
  39. END;
  40.  
  41. If you aren't using BP/TP 7.0 then replace the Seg0040 above with $40.
  42.  
  43. The first function will tell you if the users PRIMARY video card is a VGA. The 
  44. second function will tell you if the user has a card that is capable of EGA. 
  45. The card may not be the primary card, and the card may actually be VGA.
  46. The third function will tell you how many rows the screen is currently setup
  47. for.